import axios from 'axios'
import { fileStorage } from '@/config'

export const getFileBlob = (fileUrl) => {
  return axios({
    method: 'get',
    responseType: "blob",
    url: fileStorage+fileUrl
  })
}

export const downloadFile = (fileUrl) => {
  let a = document.createElement("a")
  a.href = fileStorage + fileUrl
  a.target = '_blank'
  a.style.display = 'none'
  document.body.appendChild(a)
  a.click()
  document.body.removeChild(a)
}
